package com.example.Spring.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@Aspect
public class MyAspectDemo {
    //自定义切面类
    @Before("@annotation(com.example.Spring.aspect.MyAspect)")
    public void before(){
        log.info("执行MyAspectDemo的Before方法");
    }
    @After("@annotation(com.example.Spring.aspect.MyAspect)")
    public void after(){
        log.info("执行MyAspectDemo的After方法");
    }

}
